﻿using System;
using CollegeSim.CourseScheduler.Domain.Entities;
using CollegeSim.CourseScheduler.Domain.Interfaces;
using CollegeSim.CourseScheduler.Domain.Interfaces.Repositories;
using CollegeSim.CourseScheduler.Domain.Services;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace CollegeSim.CourseScheduler.Domain.Test.Services
{
    [TestClass]
    public class CourseServiceTest
    {
        [TestMethod]
        public void GetByCRN_EmptyStringArgument_ThrowsArgumentNullException()
        {
            var assert = false;
            const string argument = "";
            var courseRepo = new Mock<ICourseRepository>();
            var courseService = new CourseService(courseRepo.Object);

            try
            {
                courseService.GetByCRN(argument);
            }
            catch (ArgumentNullException)
            {
                assert = true;
            }
            finally
            {
                Assert.IsTrue(assert);
            }
        }
    }
}
